import {
    v4 as uuidv4
} from 'uuid';

//设置临时用户身份userTempId
export const userTempId = () => {
    //先在本地缓存中查看是否设置了id
    let userId = localStorage.getItem('USERID');
    //没有id就设置一个
    if (!userId) {
        userId = uuidv4();
        localStorage.setItem('USERID', userId);
    }
    return userId;
}